﻿using System.ComponentModel.DataAnnotations;
using System.Web;
using System.Web.Mvc;
using db = XRM.Security.DataAccess.Models;

namespace XRM.Security.WebUI.Models.WorkKind
{
    public class WorkKindParamModel : BaseViewModel
    {
        public WorkKindParamModel()
        {
        }

        public WorkKindParamModel(db.WorkKindParam dbEntity)
        {
            if (dbEntity != null)
            {
                Id = dbEntity.WorkKindParamId;
                Name = dbEntity.WorkKindParamName;
                CustomId = dbEntity.CustomId;
            }
        }

        public WorkKindParamModel(db.WorkKindSpec dbEntity)
        {
            if (dbEntity != null)
            {
                Id = dbEntity.WorkKindParamId;
                Name = dbEntity.WorkKindParam.WorkKindParamName;
                CustomId = dbEntity.WorkKindParam.CustomId;
            }
        }

        public string Name { get; set; }
        public int CustomId { get; set; }
        public bool CanDelete { get; set; }
    }
}